package cn.t.web.android;

import cn.t.annotation.Runtime;
import cn.t.dto.android.AndroidSkuDTO;
import cn.t.dto.android.AndroidSkuDetailDTO;
import cn.t.facade.sku.SkuFacade;
import cn.t.vo.andriod.AndroidSkuDetailVO;
import cn.t.vo.andriod.AndroidSkuVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 安卓商品服务入口
 *
 * @author s
 * @since 2024-07-12
 */
@Slf4j
@RestController
@RequestMapping("/runtime/sku")
// "安卓商品服务")
@AllArgsConstructor
@Runtime
public class AndroidSkuController {

    private final SkuFacade facade;

    /**
     * ABB-商品查询
     */
    @PostMapping(value = "/list")
    public List<AndroidSkuVO> getList(@RequestBody @Validated AndroidSkuDTO req) {
        return facade.getList(req);
    }

    /**
     * ABB-商品详情查询-by设备货道
     */
    @PostMapping(value = "/detail")
    public List<AndroidSkuDetailVO> getDetail(@RequestBody @Validated AndroidSkuDetailDTO req) {
        return facade.getDetail(req);
    }

}

